<html>
    <title>微信支付</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/1.1.0/weui.min.css">
    <script type="text/javascript" src="https://res.wx.qq.com/open/libs/weuijs/1.1.1/weui.min.js"></script>
    <script src="http://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript">
        function pay(){
            $.ajax({
                url:'/pay/unifiedorder',
                dataType:'json',
                type:'POST',
                success:function(res){
                    if(res.error == 0){
                        weixin_pay(res.result);
                    }else{
                        weui.alert(res.info);
                    }
                }
            });
        }
	function weixin_pay(config){
	    WeixinJSBridge.invoke(
        	'getBrandWCPayRequest',config,
       		function(res){
           	    if(res.err_msg == "get_brand_wcpay_request:ok" ) {
           	        weui.alert('支付成功');
                }else{
                    weui.alert(res.err_desc);
                }
       		}
   	    );
	}
    </script>
    <body>
    <font color="#9ACD32"><b>该笔订单支付金额为<span style="color:#f00;font-size:50px">1分</span>钱</b></font><br/><br/>
    <div align="center">
        <button style="width:210px; height:50px; border-radius: 15px;background-color:#FE6714; border:0px #FE6714 solid; cursor: pointer;  color:white;  font-size:16px;" type="button" onclick="pay()" >立即支付</button>
    </div>
    </body>
</html>
